//
//  ComboCollectionViewCell.m
//  MeterMart
//
//  Created by ENERGY on 2018/11/4.
//  Copyright © 2018年 ENERGY. All rights reserved.
//

#import "ComboCollectionViewCell.h"

@interface ComboCollectionViewCell()
@property (nonatomic, strong)UILabel * titleLab;
@property (nonatomic, strong)UILabel * contentLab;
@end
@implementation ComboCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.contentView.backgroundColor = [UIColor whiteColor];
        __weak typeof (self)weakSelf = self;
        [self.contentView addSubview:self.titleLab];
        [self.contentView addSubview:self.contentLab];
        [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.contentView.mas_left).mas_offset(18/WIDTH_6_SCALE);
            make.centerY.equalTo(weakSelf.contentView.mas_centerY);
        }];
        [self.contentLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.titleLab.mas_right).mas_offset(8/WIDTH_6_SCALE);
            make.centerY.equalTo(weakSelf.contentView.mas_centerY);
        }];
        
    }return self;
}
- (UILabel *)titleLab{
    if (!_titleLab) {
        _titleLab = [[UILabel alloc] init];
        _titleLab.font = DEF_FontSize_10;
        _titleLab.textColor = [UIColor blackColor];
        _titleLab.textAlignment = NSTextAlignmentLeft;
        _titleLab.text = @"标题";
    }return _titleLab;
}
- (UILabel *)contentLab{
    if (!_contentLab) {
        _contentLab = [[UILabel alloc] init];
        _contentLab.font = DEF_FontSize_10;
        _contentLab.textColor = getColor(textGrayColor);
        _contentLab.textAlignment = NSTextAlignmentLeft;
        _contentLab.text = @"内容";
    }return _contentLab;
}
- (void)setModel:(NSDictionary *)model{
    _model = model;
    self.titleLab.text = model[@"title"];
    self.contentLab.text = model[@"content"];
}
@end
